package com.jxufe.hadoop.flowCount;

import java.io.IOException;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class FlowMapper extends Mapper<Object, Text, Text, FlowBean> {

	@Override
	public void map(Object key, Text value, Context context) throws IOException, InterruptedException {
		String line = value.toString();
		String[] fileds = line.split(" ");
		String phone = fileds[0];
		long upFlow = Long.parseLong(fileds[1]);
		long downFlow = Long.parseLong(fileds[2]);
		context.write(new Text(phone), new FlowBean(upFlow,downFlow));
	}

}
